package com.lqq.designPattern.bulider_pattern.factory.before;

//咖啡店
public class CoffeeStore {
    //点咖啡
    public Coffee orderCoffee(String type) {
        Coffee coffee = null;
        if (type.equals("AmericanCoffee")) {
            coffee = new AmericanCoffee();
        }
        else if (type.equals("LatteCoffee")) {
            coffee = new LatteCoffee();
        }
        else {
            throw new RuntimeException("没有你需要的咖啡！");
        }
        //加配料
        coffee.addMilk();
        coffee.addSugar();

        return coffee;
    }
}
